gh-140550: allow slots that repeat information from PyModuleDef#144340
Merged
encukou merged 4 commits intopython:mainfrom Feb 9, 2026
Merged
gh-140550: allow slots that repeat information from PyModuleDef#144340encukou merged 4 commits intopython:mainfrom
encukou merged 4 commits intopython:mainfrom
Conversation
When integrating slots-based module creation is with the inittab, which currently requires PyModuleDef, it would be convenient to reuse the the same slots array for the MethodDef. Allow slots that match what's already present in the PyModuleDef.
25 tasks
Contributor
|
I can confirm that with this PR the PyO3 tests all pass on my |
encukou
commented
Jan 30, 2026
encukou
commented
Jan 30, 2026
vstinner
reviewed
Feb 3, 2026
Contributor
|
Hi all - it'd be nice to have this merged by next week so this can be in 3.15a6 due out on Feb 10th. It'd be nice to not have the workaround for the old behavior committed to PyO3, see PyO3/pyo3#5753 (comment). |
thunder-coding
pushed a commit
to thunder-coding/cpython
that referenced
this pull request
Feb 15, 2026
…pythonGH-144340) When integrating slots-based module creation is with the inittab, which currently requires PyModuleDef, it would be convenient to reuse the the same slots array for the MethodDef. Allow slots that match what's already present in the PyModuleDef.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From feedback on the discussion thread:
When integrating slots-based module creation is with the inittab, which currently requires PyModuleDef, it would be convenient to reuse the the same slots array for the MethodDef.
This PR allows slots that match what's already present in the PyModuleDef.
cc @ngoldbaum
📚 Documentation preview 📚: https://cpython-previews--144340.org.readthedocs.build/